<%-- 
    Document   : index
    Created on : Apr 7, 2011, 9:43:12 AM
    Author     : Noi Nho
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="dto.User"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>User Management</title>
    </head>
    <body>
         <table>
            <tr>
                <td width="50">Username</td>
                <td width="50">Role No</td>
                <td width="100">Status</td>
                <td>Action</td>
            </tr>
            <%
                        ArrayList<User> users = (ArrayList<User>) request.getAttribute("users");
                        if (users != null) {
                            for (User item : users) {
            %>
            <tr>
                <td><% out.println(item.getUsername());%></td>
                <td><% out.println(item.getRoleNo());%></td>
                <td><% out.println(item.isStatus());%></td>
                <td><a href="administrator.jsp?page=user&action=edit&username=<% out.println(item.getUsername());%>">Update</a>, <a href="administrator.jsp?page=user&action=delete&username=<% out.println(item.getUsername());%>">Delete</a></td>
            </tr>
            <%                                }
                        }
            %>
        </table>
    </body>
</html>
